﻿using System;
using System.Collections.Generic;
using System.Text;
using EmbeddedSharp.Core;

namespace EmbeddedSharp.Core.Function.Logic {
    public class AndNode : LogicOperatorNode {

        public AndNode()
            : base() {
            this.Value = "&";
        }

        public override FuncNode GetReversedFunction(int index) {
            return new NandNode();
        }

        public override object Evaluate() {
            bool lr = Convert.ToBoolean(Left.Evaluate());
            bool rr = Convert.ToBoolean(Right.Evaluate());

            return Convert.ToString(lr && rr);
        }
    }
}
